#include "Object.h"

NS_CORE

Object::Object()
: m_RefCount(0)
{
	
}

Object::~Object()
{

}

void Object::Grab()
{
	::InterlockedIncrement(&m_RefCount);
}

void Object::Drop()
{
	assert(m_RefCount > 0);
	if (::InterlockedDecrement(&m_RefCount) == 0)
	{
		delete this;
	}
}

NS_END_CORE